package net.oschina.app.Page;

import android.widget.FrameLayout;

import net.oschina.app.SoloWrap;


/**
 * Created by kola on 2017/3/23.
 * 对导航类元素进行抽取
 */

public class PageCommon {
    private SoloWrap solo;
    private FrameLayout NewsFL, TweetFL, ExploreFL, MeFL;


    public PageCommon(SoloWrap solo) {

        this.solo = solo;
    }

    public void initViews() {
        solo.waitForText("博客");
        NewsFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_news");
        TweetFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_tweet");
        ExploreFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_explore");
        MeFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_me");
    }

    //  新闻
    public void goToNewsFL() {
        solo.clickOnView(NewsFL);
    }

    //  弹幕
    public void goToTweetFL() {
        solo.clickOnView(TweetFL);
    }

    //  探索
    public void goToExploreFL() {
        solo.clickOnView(ExploreFL);
    }

    //  我的
    public void goToMeFL() {
        solo.clickOnView(MeFL);
    }

    public void waitForText(String text) {
        solo.waitForText(text);
    }

    public void searchText(String text) {
        solo.searchText(text);
    }


}